//用户信息存、取、删封装
const USERKEY:string = 'user_key'
export function setUser(token:string):void {
    localStorage.setItem(USERKEY,token)
}

export function getUser():IUser|null {
    if (!localStorage.getItem(USERKEY)){
        return null
    }
    return JSON.parse(localStorage.getItem(USERKEY) as string)
}

export function delUser():void {
    localStorage.removeItem(USERKEY)
}